﻿using MyCode.Project.Infrastructure.Constant;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static MyCode.Project.Infrastructure.Constant.GlobalConfig;

namespace MyCode.Project.Domain.Businesses.Sms.Templates
{
    /// <summary>
    /// 短信-消费成功模板
    /// </summary>
    public class SmsConsumptionSuccessTemplate : SmsTemplateBase
    {
        /// <summary>
        /// 会员
        /// </summary>
        public string Member { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal Amount { get; set; } = 0;

        /// <summary>
        /// 积分
        /// </summary>
        public int Integral { get; set; } = 0;

        /// <summary>
        /// 微信公众号名
        /// </summary>
        public string WechatPublic { get; set; } = WechatConfigConst.WechatPublic;

        /// <summary>
        /// 初始化一个<see cref="SmsConsumptionSuccessTemplate"/>类型的实例
        /// </summary>
        public SmsConsumptionSuccessTemplate() : base(SmsTemplateConfigConst.ConsumptionSuccess)
        {
        }

        /// <summary>
        /// 初始化参数值
        /// </summary>
        protected override void InitParamValue()
        {
            Add(LxmConst.SmsTemplate.MEMBER_KEY, Member);
            Add(LxmConst.SmsTemplate.AMOUNT_KEY, Amount.ToString("F"));
            Add(LxmConst.SmsTemplate.INTEGRAL_KEY, Integral);
            Add(LxmConst.SmsTemplate.WECHAT_PUBLIC_KEY, WechatPublic);
        }
    }
}
